package xyz.luckyli;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisCommands;

/**
 * ClassName:lettuceTest
 * Package:xyz.luckyli
 * Description:
 *
 * @Date:2021/8/5 10:42
 * @Author:857251389@qq.com
 */
public class lettuceTest {

    public static void main(String[] args) {

        RedisClient client = RedisClient.create("redis://981204@124.70.161.113");

        StatefulRedisConnection<String, String> connection = client.connect();

        //sync 同步api
        RedisCommands<String, String> commands = connection.sync();


        commands.set("key","value");
        String value = commands.get("key");
        System.out.println(value);

        connection.close();

        client.shutdown();
    }


}
